package com.ln.controller;

import com.ln.vo.Result;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Ln
 * @version 终极版
 * @date 2023/1/3 14:18
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @GetMapping("delete")
    @PreAuthorize(value = "hasAnyAuthority('user:delete')")
    public Result delete(){

        return new Result(2000,"删除成功",null);
    }
    @GetMapping("insert")
    @PreAuthorize(value = "hasAnyAuthority('user:insert')")
    public Result insert(){

        return new Result(2000,"添加成功",null);
    }
    @GetMapping("update")
    @PreAuthorize(value = "hasAuthority('user:update')")
    public Result update(){

        return new Result(2000,"修改成功",null);
    }
    @GetMapping("query")
    @PreAuthorize(value = "hasAuthority('user:query')")
    public Result query(){

        return new Result(2000,"查询成功",null);
    }
    @GetMapping("export")
    @PreAuthorize(value = "hasAuthority('user:export')")
    public Result export(){

        return new Result(2000,"导出成功",null);
    }
}
